const express = require('express')
const app = express()

// 定义中间件
const mw1 = (req, res, next)=>{
	console.log('调用了局部生效的中间件')
	next()
}
const mw2 = (req, res, next)=>{
	console.log('调用第二个局部中间件')
	next()
}

// 创建路由
app.get('/',[mw1,mw2, ], (req, res) => {
	res.send('Home page')
})

app.get('/user', (req, res) => {
	res.send('Home page user 目录')
})

app.listen(80, ()=>{
	console.log('Express server runing at http://127.0.0.1')
})
